<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>发布管理</title>
	<meta name="decorator" content="default"/>
	<link rel="stylesheet" href="${ctxStatic}/ckfinder/plugins/gallery/colorbox/colorbox.css" />
	<script src="${ctxStatic}/ckfinder/plugins/gallery/colorbox/jquery.colorbox-min.js" type="text/javascript"></script>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/pub/myrelease/">发布列表</a></li>
		<shiro:hasPermission name="pub:myrelease:edit"><li><a href="${ctx}/pub/myrelease/form">信息添加</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="myrelease" action="${ctx}/pub/myrelease/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>姓名：</label>
				<form:input path="name" htmlEscape="false" maxlength="255" class="input-medium"/>
			</li>
			<%--<li><label>电话：</label>--%>
				<%--<form:input path="phone" htmlEscape="false" maxlength="255" class="input-medium"/>--%>
			<%--</li>--%>
			<li><label>类别：</label>
				<form:input path="classify" htmlEscape="false" maxlength="255" class="input-medium"/>
			</li>
			<li><label>删除标记：</label>
				<form:radiobuttons onclick="$('#searchForm').submit();" path="delFlag" items="${fns:getDictList('ad_del_flag')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>姓名</th>
				<th>电话</th>
				<th>地址</th>
				<th>类别</th>
				<%--<th>描述</th>--%>
				<th>更新时间</th>
				<shiro:hasPermission name="pub:myrelease:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="myrelease">
			<tr>
				<td>
					${myrelease.name}
				</td>
				<td>
					${myrelease.phone}
				</td>
				<td>
					${myrelease.address}
				</td>
				<td>
					${myrelease.classify}
				</td>
				<%--<td>--%>
					<%--${myrelease.describes}--%>
				<%--</td>--%>
				<td>
					<fmt:formatDate value="${myrelease.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<td>

					<a class="preview" href="javascript:void(0);" data-id="${myrelease.id}">预览</a>
					<c:forTokens items="${myrelease.images}" delims="|" var="str">
						<a class="group-${myrelease.id}" href="${str}" style="display: none;">pic1</a>
					</c:forTokens>
					<script type="text/javascript">
						$("a.group-${myrelease.id}").colorbox({rel: "group-${myrelease.id}",scalePhotos:true,maxWidth:400,maxHeight:800});
					</script>
					<shiro:hasPermission name="pub:myrelease:edit">
						<a href="${ctx}/pub/myrelease/form?id=${myrelease.id}">修改</a>
						<%--<a href="${ctx}/pub/adMake/form?id=${adMake.id}">修改</a>--%>
						<shiro:hasPermission name="pub:myrelease:audit">
							<a href="${ctx}/pub/myrelease/delete?id=${myrelease.id}${myrelease.delFlag ne 0?'&isRe=true':''}" onclick="return confirmx('确认要${myrelease.delFlag ne 0?'审核通过':'删除'}该广告吗？', this.href)">${myrelease.delFlag ne 0?'审核通过':'删除'}</a>
						</shiro:hasPermission></shiro:hasPermission>
					<%----%>

					<%--<a href="${ctx}/pub/myrelease/delete?id=${myrelease.id}" onclick="return confirmx('确认要删除该信息吗？', this.href)">删除</a>--%>
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
	<script type="text/javascript">
		$(document).ready(function() {
			$(".preview").click(function(){
//            alert("测试");
				$(".group-" + $(this).attr("data-id")).eq(0).click();
			});
		});
	</script>
</body>
</html>